package org.xjc.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author : XJC
 * @Description :返回结果,文档1和文档3要求的返回结果不同！问一下蕾姐
 * @create : 2022/1/26 22:42
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {

    private Integer code;
    private String msg;
    private Object data;

    public RespBean(Integer code, String message) {
        this.code = code;
        this.msg = message;
    }

    public static RespBean success(String msg){
        return new RespBean(200,msg);
    }
    public static RespBean success(String msg, Object data){
        return new RespBean(200,msg,data);
    }
    public static RespBean error(String msg){
        return new RespBean(500,msg);
    }
    public static RespBean error(String msg, Object data){
        return new RespBean(500,msg,data);
    }
}
